We already have a function which gets the categories of an app and
handles the null-return case, use it.
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/799
let commonCategories = [];
appInfos.reduce((categories, appInfo) => {
- const appCategories = appInfo.get_categories();
- if (!appCategories)
- return categories;
- for (let category of appCategories.split(';')) {
+ for (let category of _getCategories(appInfo)) {
if (!(category in categoryCounter))
categoryCounter[category] = 0;